package com.xinpu.mapper;

import com.baomidou.mybatisplus.annotation.SqlParser;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.xinpu.vo.DailyVo;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface DailyMapper {
    /**
     * 日报列表
     *
     * @param startTime
     * @param overTime
     * @param name
     * @param page
     * @param status
     * @return
     */
    @SqlParser(filter = true)
    IPage<DailyVo> list(String startTime, String overTime, String name, IPage<DailyVo> page, Integer status,String tenantId);

    /**
     * 日报完成情况详情
     *
     * @param id
     * @return
     */
    @Select("SELECT t_daily.*,t_sales.`name` FROM t_daily \n" +
            "LEFT JOIN t_sales\n" +
            "ON t_sales.id=t_daily.uid \n" +
            "WHERE t_daily.id=#{id}\n")
    DailyVo findById(Integer id);
}
